package com.zhitan.ems.app.iot.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhitan.ems.app.iot.entity.DevicePropertyGroupEntity;
import com.zhitan.ems.app.iot.mapper.DevicePropertyGroupMapper;
import com.zhitan.ems.app.iot.service.DevicePropertyGroupService;
import com.zhitan.ems.framework.core.mp.base.BaseServiceImpl;

@Service
public class DevicePropertyGroupServiceImpl extends BaseServiceImpl<DevicePropertyGroupMapper, DevicePropertyGroupEntity> implements DevicePropertyGroupService {
	@Override
	public List<DevicePropertyGroupEntity> getByEnergyType(Integer energyType) {
		   QueryWrapper<DevicePropertyGroupEntity> queryWrapper =new QueryWrapper<>();
		   queryWrapper.eq("energy_type", energyType);
		   queryWrapper.orderByDesc("sort_order");
		   return this.list(queryWrapper);
	}
}